package chooongg.http

import kotlinx.coroutines.Job

abstract class HttpCallback<T> {

    var exception: APIException? = null

    abstract suspend fun response(t: T)
    fun onStart(job: Job) = Unit
    abstract fun onError(e: APIException)
    fun onEnd() = Unit

    fun allotErrorDirection(e: APIException) {
        exception = e
        onError(e)
    }
}